<div class="proedit">
	<form action="<?php echo url('product/edit');?>" method="post" id="editForm">
		<table>
			<tr>
				<td width="80" class="inputtxt" align="right"><span>作品名称</span></td>
				<td align="left">
					<input type="text" class="required" name="p[name]" value="<?php echo $product['name'];?>" />
					<span style="color:red; margin-left: 6px;">*</span>
				</td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>作品分类</span></td>
				<td align="left"><?php echo fetch('categorySelect',array('name'=>'p[categoryID]','parentID'=>$product['categoryID'],'currentID'=>$product['categoryID']));?></td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>作品图片</span></td>
				<td align="left"><?php echo fetch('uploadImg',array('images'=>$images));?></td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>作品简介</span></td>
				<td align="left"><textarea name="p[description]" rows="4" cols="100"><?php echo $product['description'];?></textarea></td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>作品详情</span></td>
				<td align="left"><textarea id="ckeditor" name="p[content]"><?php echo $product['content'];?></textarea></td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>搜索关键字</span></td>
				<td align="left"><input type="text" name="p[keyword]" value="<?php echo $product['keyword'];?>" /></td>
			</tr>
			<tr align="right"><td colspan="2"><input type="submit" onClick="CKupdate();" value="修改" id="catesub" /></td></tr>
		</table>
		<input type="hidden" name="id" value="<?php echo $product['id'];?>" />
	</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
	CKEDITOR.replace('ckeditor',{
		filebrowserImageUploadUrl:"<?php echo url('image/ckUpload');?>",
		//filebrowserImageBrowseUrl:"<?php echo url('image/ckBrowse');?>",
	});
	submitForm("#editForm",{
		dataType:'json',
		success:function(data){
				if(data.i=='ok'){
					location.href="<?php echo url('product/index');?>";
				}else{
					alert(data.i);
				}
			},
	});
});
</script>
